﻿using System.Drawing;
using System.Windows.Forms;

namespace T2ReportsAssistant
{
    public partial class SetupForm : Form
    {
        public SetupForm()
        {
            InitializeComponent();
            this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            settingsBindingSource.DataSource = Settings.Instance;
            useExtCmdCheckBox_CheckedChanged(this, System.EventArgs.Empty);
            useResFileCheckBox_CheckedChanged(this, System.EventArgs.Empty);
        }

        public string IdPassword
        {
            get { return passwordTextBox.Text; }
            set { passwordTextBox.Text = value; }
        }

        private void useResFileCheckBox_CheckedChanged(object sender, System.EventArgs e)
        {
            resultsFileTextBox.ReadOnly = !useResFileCheckBox.Checked;
        }

        private void useExtCmdCheckBox_CheckedChanged(object sender, System.EventArgs e)
        {
            externalCommandTextBox.ReadOnly = !useExtCmdCheckBox.Checked;
            runMzdCheckBox.Enabled = useExtCmdCheckBox.Checked;
        }
    }
}
